/**
 * Created by jijin on 2017/7/8.
 */

import React, { Component } from 'react';
import {
  View,
  StyleSheet,
  StatusBar,
  Image
} from  'react-native';

//styles
import {AppColors, AppSizes} from '@app/style';
//Init layout
import Layout from './layout';

export default class Welcome extends Component {

  componentWillMount() {
    let { navigator } = this.props;
    setTimeout(() => {
      navigator.replace({component: Layout, passProps: {navigator}})
    }, 1666);
  }

  render() {
    return (
      <View style={styles.container}>
        <StatusBar
          translucent={true}
          backgroundColor={'#rgba(0, 0, 0, 0)'}
          barStyle={'light-content'}
          showHideTransition={'slide'}
          hidden={false}
        />
        <Image style={styles.launchImage} source={require('../images/android-launch/launch-image.png')}/>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: AppColors.background,
    alignItems: 'center',
    justifyContent: 'center'
  },
  launchImage: {
    position: 'absolute',
    left: 0,
    top: 0,
    width: AppSizes.screen.width,
    height: AppSizes.screen.height
  }
});